<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>sticky 粘性定位</title>
    <style>
      * {
        padding: 0px;
        margin: 0px;
      }

      .box1 {
        width: 200px;
        height: 200px;
        line-height: 200px;
        background-color: coral;
        text-align: center;
        position: sticky;
        left: 50px;
        bottom: 10px;
      }
    </style>
  </head>
  <body>
    <p>
      sticky（粘性定位）：对象在常态时遵循常规流。它就像是relative和fixed的合体，当在屏幕中时按常规流排版，当卷动到屏幕外时则表现如fixed。该属性的表现是现实中你见到的吸附效果。（CSS3）
    </p>
    <!-- 模拟滚动条 -->
    <div style="height: 1000px"></div>
    <div class="box1">sticky</div>
  </body>
</html>
